const state = {
  isCollapse: false,
  selectMenu: []
}

const mutations = {
  toggleSideBar(state) {
    state.isCollapse = !state.isCollapse
  },
  // 新增选中菜单处理
  setSelectMenu(state, menu) {
    state.selectMenu = menu
  }
}

const actions = {
  toggleCollapse({ commit }) {
    commit('toggleSideBar')
  }
}

export default {
  namespaced: true,  // 添加命名空间
  state,
  mutations,
  actions
}